function sort(arr) {
	if (arr.length <= 1) {
		return arr
	}
	const pivot = arr.splice(0, 1)[0]
	const left = [],
		right = []

	arr.forEach((item, index) => {
		if (item < pivot) {
			left.push(item)
		} else {
			right.push(item)
		}
	})
	// return arrSort(left).concat(pivot,arrSort(right))
	return [...sort(left), pivot, ...sort(right)]
}
